package bank.project;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBConnect {
	private static Connection con;
	public static Connection getCon(String id,String pwd) throws SQLException{
		try{
			Class.forName("oracle.jdbc.driver.OracleDriver");
			String url="jdbc:oracle:thin:@localhost:1521:XE";
			con=DriverManager.getConnection(url,id,pwd);
			return con;
		}catch(ClassNotFoundException ce){
			System.out.println(ce.getMessage());
			return null;
		}
	}
	public static Connection getCon() throws SQLException{
		try{
			Class.forName("oracle.jdbc.driver.OracleDriver");
			String url="jdbc:oracle:thin:@localhost:1521:XE";
			con=DriverManager.getConnection(url,"scott","tiger");
			return con;
		}catch(ClassNotFoundException ce){
			System.out.println(ce.getMessage());
			return null;
		}
	}
	
}
